<template>
  <div>
    <el-container style="height: 100%; border: 1px solid #eeeeee">
      <el-aside width="200px" style="background-color: rgb(241,246,238)">
        <el-menu router :default-openeds="['0','1']">
          <el-submenu v-for="(item, index) in $router.options.routes" :index="index+''" v-if="item.show">
            <template slot="title"><i class="el-icon-message"></i>{{item.name}}</template>
            <el-menu-item
                v-for="(item2, index2) in item.children"
                :index="item2.path"
                :class="$route.path == item2.path ? 'is-active': ''">{{item2.name}}</el-menu-item>
          </el-submenu>
        </el-menu>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </div>
</template>

<script>
import HelloWorld from './components/HelloWorld.vue'
export default {
  name: 'app',
  components: {
    HelloWorld
  },
  data() {
    const item = {
      date: '2016-05-02',
      name: '王小虎',
      address: '上海市普陀区金沙江路 1518 弄'
    };
    return {
      tableData: Array(20).fill(item)
    }
  }
}
</script>

<style scoped>
.el-header {
  background-color: #ccc;
  color: #333;
  line-height: 60px;
}

.el-aside {
  color: #630915;
}
</style>


